<?php if (Yii::app()->controller->route == 'site/index') : ?>
<?php $this->beginContent('//layouts/home'); ?>
<?php else : ?>
<?php $this->beginContent('//layouts/main'); ?>
<?php endif; ?>
<div id="container" class="clearfix">
    <div class="col1">
        <?php
        $route = strtolower($this->route);
        if (in_array($route,array('article/default/listbycategory','product/default/listbycategory','product/default/index','site/documents/listbycategory','article/default/view','product/default/view','site/documents/view')))
        {
            if (in_array($route,array('article/default/view','product/default/view','site/documents/view')))
                $selectedCatId = $this->get('cat_id',0);
            else
            {
                if ($route == 'product/default/index')
                    $selectedCatId = ProductSettings::ROOT_CATEGORY_ID;
                else
                    $selectedCatId = $this->get('id',0);
            }
            $parentCatIds = FSM::run('Core.Category.getParentIds',array('id'=>$selectedCatId))->ids;
            if (in_array(ArticleSettings::NEWS_CATEGORY_ID,$parentCatIds))
                $this->widget('Site.components.SideBarCategoryListWidget',array('type'=>'article','category_id'=>ArticleSettings::NEWS_CATEGORY_ID,'hieCatIds'=>$parentCatIds,'cssClass'=>'box gray'));
            elseif (in_array(ProductSettings::ROOT_CATEGORY_ID,$parentCatIds))
                $this->widget('Site.components.SideBarCategoryListWidget',array('type'=>'product','category_id'=>ProductSettings::ROOT_CATEGORY_ID,'hieCatIds'=>$parentCatIds,'cssClass'=>'box gray'));    
            elseif (in_array(SiteSettings::ROOT_DOCUMENT_CATEGORY_ID,$parentCatIds))
                $this->widget('Site.components.SideBarCategoryListWidget',array('type'=>'document','category_id'=>SiteSettings::ROOT_DOCUMENT_CATEGORY_ID,'hieCatIds'=>$parentCatIds,'cssClass'=>'box gray'));
            else
                $this->widget('Article.components.SideBarArticlesWidget',array('category_id'=>ArticleSettings::ABOUT_US_CATEGORY_ID,'cssClass'=>'box gray'));
        }
        else
            $this->widget('Article.components.SideBarArticlesWidget',array('category_id'=>ArticleSettings::ABOUT_US_CATEGORY_ID,'cssClass'=>'box gray')); ?>
        <div class="box green">
            <?php
            $this->widget('Site.components.BrainSlideShowWidget',array(
                    'title'=>Yii::t('site/general','Partners'),
                    'galleryId'=>'brands-slideshow',
                )
            );?>
        </div>
    </div>
    <div class="col2">
        <?php echo $content;?>
    </div>
    <div class="col3">
        <div class="box blue">
            <?php
            $this->widget('GoldRateWidget',array(
                'title'=>"<h3 class='title'>".Yii::t('site/general','Market Info').' ('.date('d-m-Y').')'."</h3>",
                'id'=>'gold-widget'
        ));
            ?>
        </div>
        <div class="box gray">
            <?php $this->widget('Site.components.TopNewsWidget',array(
            'title'=>Yii::t('site/general','News'),
            'category_id'=>ArticleSettings::NEWS_CATEGORY_ID,
            ));?>
        </div>
        <div class="box green white">
            <h3 class="title"><?php echo Yii::t('site/general','Online Support'); ?></h3>
            <table class="online-support">
                <tr>
                    <td><?php echo Yii::t('site/general','Sales Department').'(Yahoo)'; ?></td>
                    <td>
                        <a href="ymsgr:sendIM?<?php echo SiteSettings::SALES_DEPARTMENT_YAHOO_NICK; ?>" style="float:left;margin:2px 0 0 0;">
                            <img src="http://presence.msg.yahoo.com/online?u=<?php echo SiteSettings::SALES_DEPARTMENT_YAHOO_NICK; ?>&m=g&t=1" alt=""/>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td><?php echo Yii::t('site/general','Sales Department').'(Skype)'; ?></td>
                    <td>
                        <a href="skype:<?php echo SiteSettings::SALES_DEPARTMENT_SKYPE_NICK; ?>?chat" style="float:left;margin:2px 0 0 0;">
                            <img width="79px" height="28px" src="http://mystatus.skype.com/bigclassic/<?php echo SiteSettings::SALES_DEPARTMENT_SKYPE_NICK; ?>" alt=""/>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td><?php echo Yii::t('site/general','Advisory Support').'(Yahoo)'; ?></td>
                    <td>
                        <a href="ymsgr:sendIM?<?php echo SiteSettings::ADVISORY_SUPPORT_YAHOO_NICK; ?>" style="float:left;margin:2px 0 0 0;">
                            <img src="http://presence.msg.yahoo.com/online?u=<?php echo SiteSettings::ADVISORY_SUPPORT_YAHOO_NICK; ?>&m=g&t=1" alt=""/>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td><?php echo Yii::t('site/general','Advisory Support').'(Skype)'; ?></td>
                    <td>
                        <a href="skype:<?php echo SiteSettings::ADVISORY_SUPPORT_SKYPE_NICK ; ?>?chat" style="float:left;margin:2px 0 0 0;">
                            <img width="79px" height="28px" src="http://mystatus.skype.com/bigclassic/<?php echo SiteSettings::ADVISORY_SUPPORT_SKYPE_NICK; ?>" alt=""/>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="hotline mobile"><?php echo SiteSettings::SUPPORT_PHONE; ?></td>
                </tr>
            </table>
        </div>
        <div class="box gray">
            <h3 class="title"><?php echo Yii::t('site/general','Statistics'); ?></h3>
            <div class="statistics">
                <!-- Histats.com  START  (standard)-->
                <script type="text/javascript">document.write(unescape("%3Cscript src=%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script%3E"));</script>
                <a href="http://www.histats.com" target="_blank" title="free html hit counter" ><script  type="text/javascript" >
                try {Histats.start(1,1995825,4,403,118,80,"00011111");
                Histats.track_hits();} catch(err){};
                </script></a>
                <noscript><a href="http://www.histats.com" target="_blank"><img  src="http://sstatic1.histats.com/0.gif?1995825&101" alt="free html hit counter" border="0"></a></noscript>
                <!-- Histats.com  END  -->
            </div>
        </div>
    </div>
</div>
<?php $this->endContent(); ?>
